<!--欢迎界面-->
<!--欢迎界面-->
<template>
  <div>
    <h1 class="title1">欢迎来到万物互联平台</h1>
    <span class="title2">实时测量温湿度的工具</span>
    <div class="block">
      <el-carousel height="400px">
        <el-carousel-item v-for="item in 2" :key="item">
            <img class="carousel-image" :src="images[item - 1]" >
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
//import axios from 'axios'
export default {
    data() {
        return {
            // 假设这是你的图片数组，包含图片的URL
            images: [
                require('../../static/_DCS0121_1.jpg'),
                require('../../static/_DCS9428.jpg'),
            ]
        };
    },
    // async created() {
    // let user = JSON.parse(localStorage.getItem("honey-user") || '{}')
    // const config = {
    //       headers: {
    //           // 设置内容类型为JSON
    //           'Content-Type': 'application/json;charset=UTF-8',
    //           // 添加token到请求头
    //           'token': user.token || '',
    //       }
    // }
    // //this.$request.post('/device',this.formLabelAlign).then(res => {
    // const res = await axios.get('http://127.0.0.1:8000/page',config)
    // if(res.data.code === '401')
    //     this.$router.push('/')
// },
}
</script>

<style>

  .title1{
    font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
    margin-top: 50px;
    margin-bottom: 0px;
    padding: 0px;
    height:10px;
    width: calc(100% - 30px);
    text-align: center;
    line-height: 50px;
    font-size: 50px;
  }
  .title2{
    padding: 0px;
    margin: 0px;
    height: 60px;
    width: calc(100% - 30px);
    line-height: 40px;
    letter-spacing: 20px;
  }

  .block{
    height: 300px;
    width: 1000px;
    margin: auto;
    padding: 0px;

  }

  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }

  .carousel-image {
      width: 100%; /* 根据需要调整图片宽度 */
      height: 100%;/* 根据幻灯片容器的高度调整图片高度 */
      object-fit: cover; /* 确保图片按比例填充容器 */
  }
</style>